package com.happycat.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.happycat.Pagination;
import org.springframework.web.bind.annotation.RequestBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.happycat.ResponseModel;
import com.happycat.ResponseHeaderModel;
import com.happycat.mobile.model.UserOfficialAccount;
import com.happycat.mobile.service.UserOfficialAccountService;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liaoyong
 * @since 2020-08-02
 */
@RestController
@RequestMapping("/userOfficialAccount")
@Api(value = "用户关注粉丝", description = "用户关注粉丝接口")
public class UserOfficialAccountController {
    @Autowired
	private UserOfficialAccountService userOfficialAccountService;
	
	@ApiOperation(value = "用户关注粉丝详情")
    @RequestMapping(method = RequestMethod.POST, value = "/detail")
	public ResponseModel<UserOfficialAccount> detail(@RequestBody UserOfficialAccount userOfficialAccount){
		return userOfficialAccountService.selectOne(userOfficialAccount);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/page")
	@ApiOperation(value = "用户关注粉丝分页列表,查询粉丝accountId必传，查询关注focusId必传")
	public ResponseModel<Page<UserOfficialAccount>> Page(@RequestBody Pagination<UserOfficialAccount>page){
		return userOfficialAccountService.pageList(page);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/add")
	@ApiOperation(value = "用户关注粉丝新增")
	public ResponseHeaderModel add(@RequestBody UserOfficialAccount userOfficialAccount){
	
	   return userOfficialAccountService.add(userOfficialAccount);
	}
	@ApiOperation(value = "用户关注粉丝编辑")
	@RequestMapping(method = RequestMethod.POST, value = "/modify")
	public ResponseHeaderModel modify(@RequestBody UserOfficialAccount userOfficialAccount){
	
	   return userOfficialAccountService.modify(userOfficialAccount);
	}
	
	@ApiOperation(value = "编辑")
	@RequestMapping(method = RequestMethod.POST, value = "/getCount")
	public ResponseModel<UserOfficialAccount> getCount(@RequestBody UserOfficialAccount userOfficialAccount){
	
	   return userOfficialAccountService.getCount(userOfficialAccount);
	}
	
}

